const log = console.log.bind(console)

const e = function(selector) {
    return document.querySelector(selector)
}

const es = function(selector) {
    return document.querySelectorAll(selector)
}
const arrayString = function(array) {
    let r = ''
    for (let i = 0; i < array.length; i++) {
        r = r + JSON.stringify(array[i]) + '\n'
    }
    return r
}
const logArray = function(arr) {
    log(arrayString(arr))
}
const bindAll = function(selector, eventName, callback) {
    let elements = es(selector)
    for (let i = 0; i < elements.length; i++) {
        let e = elements[i]
        bindEvent(e, eventName, callback)
    }
}
const bindEvent = function(element, eventName, callback) {
    element.addEventListener(eventName, callback)
}
const appendHtml = function(element, html) {
    element.insertAdjacentHTML('beforeend', html)
}
const find = function(element, selector) {
    return element.querySelector(selector)
}
const findAll = (element, selector) => {
    return element.querySelectorAll(selector)
}
